<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: wsq547
  Date: 2021/10/4
  Time: 14:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>所有学生</title>


    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">


</head>
<body>
<div class="container">

    <div class="row">
        <div class="col-md-4 column">
            <h3>信息展示</h3>
        </div>

    </div>

<div class="row">
    <div class="col-md-4 column">
        <a class="btn btn-primary" href="${pageContext.request.contextPath}/student/addStudentPage">新增学生</a>
        <a class="btn btn-primary" href="${pageContext.request.contextPath}/student/allStudent">显示所有学生</a>
    </div>

    <div class="col-md-3 column">

    </div>



    <div class="col-md-3 column">
        <%--查询学生--%>
            <span style="color: red;font-weight: bold">${error}</span>
        <form action="${pageContext.request.contextPath}/student/queryStudentByName" method="post" class="form-inline">
            <input type="text"   name="queryStudentName" class="form-control" placeholder="输入要查询的学生姓名">
            <input type="submit" value="查询" class="btn btn-primary">
        </form>
    </div>


    <div class="col-md-2 column">
        <p>
            管理员:<span>${userLoginInfo}</span>
            <a href="${pageContext.request.contextPath}/admin/goOut">注销</a>

        </p>
        <p><a href="${pageContext.request.contextPath}/admin/toIndexPage">回到首页</a></p>
    </div>

</div>



<div class="panel panel-default">
    <!-- Default panel contents -->
    <div class="panel-heading">


    </div>

    <!-- Table -->
    <table class="table">
        <thead>
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>年级</th>
                <th>语文</th>
                <th>数学</th>
                <th>英语</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <c:forEach var="list" items="${requestScope.get('studentList')}">
                <tr>
                    <td>${list.getStudentNo()}</td>
                    <td>${list.getStudentName()}</td>
                    <td>${list.getGrade()}</td>
                    <td>${list.getChinese()}</td>
                    <td>${list.getMath()}</td>
                    <td>${list.getEnglish()}</td>
                    <td>
                        <a href="${pageContext.request.contextPath}/student/updateStudentPage?id=${list.getStudentNo()}">修改</a>
                        <a href="${pageContext.request.contextPath}/student/deleteStudent?id=${list.getStudentNo()}">删除</a>
                    </td>
                </tr>

            </c:forEach>
        </tbody>
    </table>
</div>
</div>
</body>
</html>
